﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

using System.Threading;

using MIRIA.UIKit;
using MIRIA.Animations;

namespace MIRIADemo.Pages.MainMenu
{
    public partial class X10HALButton : TButton
    {
        public X10HALButton()
        {
            InitializeComponent();
        }

        public void Animate()
        {
            Animator.PlayScript(delegate()
            {
                while (true)
                {
                    //
                    Thread.Sleep(5000);
                    //
                    Animator.AnimateProperty(LightImage, "Opacity", 1.00, 0.20, 0.10, 0.00, null);
                    Animator.AnimateProperty(Description, "Opacity", 0.75, 0.20, 0.10, 0.00, null);
                    Animator.AnimateProperty(ButtonBackground, "Opacity", 1.00, 0.20, 0.05, 0.15, null);
                    //
                    Thread.Sleep(10000);
                    //
                    Animator.AnimateProperty(LightImage, "Opacity", 0.20, 0.75, 0.25, 0.00, null);
                    Animator.AnimateProperty(Description, "Opacity", 0.20, 0.75, 0.25, 0.00, null);
                    Animator.AnimateProperty(ButtonBackground, "Opacity", 0.20, 0.75, 0.25, 0.20, null);
                    Animator.AnimateProperty(Slogan, "Opacity", 0.00, 1.00, 2.00, 1.00, null);
                    //
                    Thread.Sleep(5000);
                    //
                    Animator.AnimateProperty(Slogan, "Opacity", 1.00, 0.00, 2.00, 1.00, null);
                }
            });
        }

        private void TButton_Loaded(object sender, RoutedEventArgs e)
        {

        }


    }
}
